package 设计模式.o_命令模式;

/**
 * @author caihe
 * @date 2023/3/21 15:33
 */
public class Test {
    public static void main(String[] args) {
        
        Invoker invoker = new Invoker();
        Light light = new Light();
        Command lightOnCommand = new LightOnCommand(light);
        Command lightOffCommand = new LightOffCommand(light);
        
        invoker.setOnCommand(lightOnCommand, 0);
        invoker.setOffCommand(lightOffCommand, 0);
        invoker.onButtonWasPushed(0);
        invoker.offButtonWasPushed(0);
    }

}
